{% extends "ITInfluence/base.html" %}

{% block page %}
<p>Tweet count: {{ tweetCount }}</p>
<p>Displaying {{ tweetsPerPage }} tweet{{tweetsPerPage|pluralize}} per page</p>

<div class="pagination">
    <span class="step-links">
        {% if tweets.has_previous %}
            <a href="?page={{ tweets.previous_page_number }}&tpp={{ tweetsPerPage }}">Previous</a> -
        {% endif %}

        <span class="current">
            Page {{ tweets.number }} of {{ tweets.paginator.num_pages }}
        </span>

        {% if tweets.has_next %}
            - <a href="?page={{ tweets.next_page_number }}&tpp={{ tweetsPerPage }}">Next</a>
        {% endif %}
    </span>
</div>

<table border="1">
<thead>
<tr>
<th>Tweet ID</th>
<th>Author</th>
<th>Followers count</th>
<th>Reply to</th>
<th>Text</th>
<th>Created at</th>
<th>Polarity</th>
</tr>
</thead>

<tbody>
{% for tweet in tweets %}
<tr>
<td>{{ tweet.id }}</td>
<td>{{ tweet.user.screen_name }}</td>
<td>{{ tweet.user.followers_count }}</td>
<td>{{ tweet.in_reply_to_status_id }}</td>
<td>{{ tweet.text }}</td>
<td>{{ tweet.created_at }}</td>
<td>{{ tweet.polarity }}</td>
</tr>
{% endfor %}

</tbody>
</table>

<div class="pagination">
    <span class="step-links">
        {% if tweets.has_previous %}
            <a href="?page={{ tweets.previous_page_number }}&tpp={{ tweetsPerPage }}">Previous</a> -
        {% endif %}

        <span class="current">
            Page {{ tweets.number }} of {{ tweets.paginator.num_pages }}
        </span>

        {% if tweets.has_next %}
            - <a href="?page={{ tweets.next_page_number }}&tpp={{ tweetsPerPage }}">Next</a>
        {% endif %}
    </span>
</div>

{% endblock page %}